﻿using System;
using System.Collections;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using Jy123.Common;

namespace Jy123.Web.home
{
    public class LogOut : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            string strUserIdFromCookie = Cookie.getCookie("UserID");
            if (string.IsNullOrEmpty(strUserIdFromCookie))
            {
                context.Response.Redirect("/");
                int userID = int.Parse(strUserIdFromCookie);
            }
            Cookie.DelCookie("UserID");
            Cookie.DelCookie("UserName");
            Cookie.DelCookie("UserEmail");
            context.Response.Redirect("/");
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
